package com.lpz.wdbc;

import org.springframework.jdbc.core.JdbcTemplate;

/**
 * 
 * @author Administrator
 * @date 2017年5月5日
 */
public class DbOperator {
    
    private String dilgt;
    
    Class<?> clazz = null;
    
    DbOperator(Class<?> clazz){
        this.clazz = clazz;
    }
    
    private JdbcTemplate  template;
    
    public JdbcTemplate getTemplate() {
        return template;
    }
    
    public void setTemplate(JdbcTemplate template) {
        this.template = template;
    }
    
    public <T> T get(Object id) {
        try {
            return (T) clazz.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    
    
    public <T> void add(T entity){
        String sql = "";
        
        
        clazz.cast(entity);
        
        
//        template.UPDA
    }
    
    
    
}
